from django.http import JsonResponse


class ResultTools:
    @staticmethod
    def ok(data=""):
        return JsonResponse({
            'status': '200',
            'data': data
        }, safe=False)

    @staticmethod
    def error(msg=""):
        return JsonResponse({
            'status': '500',
            'data': msg
        }, safe=False)

    @staticmethod
    def relogin(msg=""):
        return JsonResponse({
            'status': '502',
            'data': msg
        }, safe=False)
